# @Time:2021/6/12 23:35
# @Author:5120195554王欣霏
# -*- coding = utf-8 -*-

import pygame
from pygame.constants import QUIT
from scene import SceneResult
from pygame.constants import QUIT, KEYDOWN, K_y, K_F11
from scene.temple_scene import TempleScene
from actor.swk import SWK


class TheEndScene(object):
    '''
    游戏结束 成功和失败两种情况
    '''

    def __init__(self, state):
        # if state == SceneResult.Win and len(TempleScene.__init__(swk,surface).monster_group) == 0:
        if state == SceneResult.Win:
            image = pygame.image.load('../resource/img/win.jpg')
        # if state == SceneResult.Fail or len(TempleScene.__init__(swk,surface).monster_group) > 0:
        if state == SceneResult.Fail:
            image = pygame.image.load('../resource/img/fail.jpg')
        self.image = pygame.transform.scale(image, (800, 600))

    def run(self, surface: pygame.Surface):
        clock = pygame.time.Clock()
        fullscreen = False
        surface.blit(self.image, (0, 0))
        exit = False
        while not exit:
            for event in pygame.event.get():
                if event.type == QUIT:
                    exit = True
            surface.blit(self.image, (0, 0))
            clock.tick(20)
            pygame.display.update()
